package com.spark.lola.logistics.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.spark.lola.logistics.constant.LogisticsConstant;
import com.spark.lola.support.common.constant.CommonConstant;
import com.spark.lola.support.common.entity.ShiroUser;
import com.spark.lola.support.mybatis.entity.BaseModel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @author: Zhi-peng wang
 * @date: 2020/04/24 09:54
 * 车辆信息
 **/
@Getter
@Setter
@ApiModel(value = "CarInfo", description = "车辆信息")
@TableName("logistics_car_info")
public class CarInfo extends BaseModel {

    @ApiModelProperty(name = "no", value = "车牌号")
    private String no;

    @ApiModelProperty(name = "name", value = "别名")
    private String name;

    @ApiModelProperty(name = "tag", value = "汽车标签", notes = "品牌+型号+颜色")
    private String tag;

    @ApiModelProperty(name = "loadWeight", value = "核载重量", notes = "单位t")
    private BigDecimal loadWeight = new BigDecimal(0);

    @ApiModelProperty(name = "mileage", value = "里程数", notes = "单位km")
    private Integer mileage = 0;

    @ApiModelProperty(name = "isBind", value = "是否绑定", notes = "是否绑定驾驶员（0-未绑定，1-绑定）")
    private Integer isBind = LogisticsConstant.CarIsBind.N_BIND;

    @ApiModelProperty(name = "carLicense", value = "车辆行驶证")
    private String carLicense;

    @ApiModelProperty(name = "carLicenseIndate", value = "行驶证有效期")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date carLicenseIndate;

    @ApiModelProperty(name = "compulsoryInsurance", value = "交强险保单")
    private String compulsoryInsurance;

    @ApiModelProperty(name = "compulsoryInsuranceIndate", value = "交强险有效期")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date compulsoryInsuranceIndate;

    @ApiModelProperty(name = "commercialInsurance", value = "商业险保单")
    private String commercialInsurance;

    @ApiModelProperty(name = "commercialInsuranceIndate", value = "商业险有效期")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date commercialInsuranceIndate;

    @ApiModelProperty(name = "inspection", value = "年检单")
    private String inspection;

    @ApiModelProperty(name = "inspectionIndate", value = "年检有效期")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date inspectionIndate;

    @ApiModelProperty(name = "remark", value = "备注")
    private String remark;

    @ApiModelProperty(name = "used", value = "状态", notes = "Y-启用，N-禁用，W-待绑定")
    private String used = CommonConstant.Y;

    @ApiModelProperty(name = "creator", value = "创建人")
    @TableField(fill = FieldFill.INSERT)
    private String creator;

    @ApiModelProperty(name = "updator", value = "修改人")
    @TableField(fill = FieldFill.UPDATE)
    private String updator;

    @ApiModelProperty(name = "createTime", value = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    @ApiModelProperty(name = "updateTime", value = "修改时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    @ApiModelProperty(name = "driverInfo", value = "驾驶员信息")
    @TableField(exist = false)
    private ShiroUser driverInfo;

}
